package com.study.manage.web.user;

import com.study.manage.entity.UserDTO;
import com.study.manage.entity.UserRolesVO;
import com.study.manage.entity.UserSearchDTO;
import com.study.manage.pojo.ResponseResult;
import com.study.manage.pojo.Role;
import com.study.manage.pojo.User;
import com.study.manage.service.AuthService;
import com.study.manage.service.RoleService;
import com.study.manage.service.UserService;
import com.study.manage.utils.DateUtil;
import com.study.manage.utils.IStatusMessage;
import com.study.manage.utils.PageDataResult;
import com.study.manage.utils.ValidateUtil;
import lombok.extern.slf4j.Slf4j;
import net.sf.oval.ConstraintViolation;
import net.sf.oval.Validator;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.*;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.cache.Cache;
import org.apache.shiro.cache.ehcache.EhCacheManager;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.text.ParseException;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * @项目名称：study.manage
 * @包名：com.study.manage.web.user
 */
@Controller
@RequestMapping("/role")
@Slf4j
public class RoleController {

	@Autowired
	private RoleService roleService;

	/**
	 * 查询用户数据
	 * @return map
	 */
	@RequestMapping(value = "/getRoles" )
	@ResponseBody
	public List<Role> getRoles() {
		log.debug("查询角色数据" );
		List<Role> list = new ArrayList<Role>();

		list = roleService.getRoles();
		return list;
	}

}
